<?php

Yii::import('zii.widgets.grid.CGridColumn');

class MyStatusColumn extends CGridColumn
{
	public $items_status;

	public $update_controller;
	public $update_action;
	public $table;
	public $id_name;
	public $prefix = 'select';
	public $suffix = false;
	public $popup_disabled = false;
	public $status_rev;
	public $hidden = false;
	public $status_field = 'status';
	public $id_field = 'id';

	protected function renderDataCellContent($row,$data)
	{
		app()->controller->renderPartial('//common/select_popup', array(
			'items_status' => $this->items_status,
			'update_controller' => $this->update_controller,
			'update_action' => $this->update_action,
			'table' => $this->table,
			'id_name' => $this->id_name,
			'prefix' => $this->prefix,
			'suffix' => $this->suffix,
			'popup_disabled' => $this->popup_disabled,
			'status_rev' => $this->status_rev,
			'hidden' => $this->hidden,

			'id' => $data->{$this->id_field},
			'status' => $data->{$this->status_field},
		));
	}
}